package com.hnx.admin.system.domain.vo.user;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Set;

/*
项目名称： core
创 建 人: 倔强的头发
创建日期： 2025/5/29   10:38:24 
描   述：
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDetailVO implements UserDetails {
    private UserVO userVO;
    private Set<String> permission;
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return userVO.getPassword();
    }

    @Override
    public String getUsername() {
        return userVO.getUsername();
    }
    @Override
    public boolean isEnabled() {
        return userVO.getStatus() == 0;
    }
}
